<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="imports.jsp"%>
<html>

<head>

	 			 			<script type="text/javascript">
function submitform()
{
    document.forms["myform"].submit();
}
</script>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" media="screen" type="text/css" title="style" href="style.css"/>
	<title>Super mega site d'e-commerce de livres</title>
</head>
<body>
<div id="wrapper">
	<div id="header">
		<div id="logo">
		<h1>e-commerce de livres</h1>
		
			
		</div>
		
	</div>
	<!-- end #header -->
	<div id="menu">
			<jsp:include page="header.jsp"/>
	</div>
	<!-- end #menu -->
	<div id="page">
	<div id="page-bgtop">
	<div id="page-bgbtm">
	
	
		<div id="content">
		<c:forEach var="book" items="${articles}">
			<div class="post">
				<h2 class="title"><a href="/e-commerceWeb/ArticleDetail?articleid=${book.id}">${book.title}</a></h2>
				<div class="entry">
					
					<table style="width: 100%">
			
				<tr>
					<td style="width: 100px">
					
					<img src=<%=request.getContextPath() + "/images/style/noimage.gif"%> width="100 px">
					
					</td>
					<td style="padding-left:10px;">
				 		de ${book.author}<br/>
				 		Genre(s) : 
				 		<c:forEach var="genre" items="${book.genres}" varStatus="genreCount">
				 			<c:if test="${genreCount.count > 1}">
				 				/ 
				 			</c:if>
				 			${genre}
				 		</c:forEach>
				 	</td>
				 	<td style="width: 20%">
				 		<fmt:formatNumber value="${book.price}" type="currency" currencySymbol="&euro;"/><br/>
				 		<form id="myform" method="post" action="AddToCart">
				 			<input type="hidden" name="articleId" value="${book.id}">
				 			<div class="purchase">
				 			<a  href="javascript:submitform();"></a>
								</div>

				 		</form>


				 	</td>
				 </tr>
			
		</table>
					
					
					</div>
					
					
			</div>
			</c:forEach>
		<div id="endcontent">
		 <c:if test="${pagination > 0}">Page:</c:if> 
		<c:forEach var="entry" begin="1" end="${pagination}">
			<c:choose>
						<c:when  test="${idpage==null && entry==1}">
							${entry}&nbsp;
						</c:when>
						<c:when  test="${idpage!=null && entry==idpage}">
							${entry}&nbsp;
						</c:when>
						<c:otherwise>	
							<a href="${origine}idpage=${entry}">${entry}</a>&nbsp;
						</c:otherwise>
			</c:choose>
		</c:forEach>	
				</div>	
		</div>
		<!-- end #content -->
		
		
		<div id="sidebar">
			<ul>
				<jsp:include page="admin.jsp"/>
				<jsp:include page="categories.jsp"/>
			</ul>
		</div>
		<!-- end #sidebar -->
		<div style="clear: both;">&nbsp;</div>
	</div>
	</div>
	</div>
	<!-- end #page -->
</div>
	<div id="footer">
		<p>Copyright (c) 2011. All rights reserved.</p>
	</div>
	<!-- end #footer -->

</body>
</html>





	














